package org.ejc.persist.model;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import org.apache.commons.lang.builder.ToStringBuilder;


/** @author Hibernate CodeGenerator */
public class Transaction implements Serializable {

    /** identifier field */
    private Integer transactionId;

    /** nullable persistent field */
    private Timestamp transactionDate;

    /** nullable persistent field */
    private Double transactionAmount;

    /** persistent field */
    private org.ejc.persist.model.Convention convention;

    /** persistent field */
    private org.ejc.persist.model.ConventionExecutive conventionExecutive;

    /** persistent field */
    private org.ejc.persist.model.Registrant registrant;

    /** persistent field */
    private org.ejc.persist.model.Price price;

    /** full constructor */
    public Transaction(Integer transactionId, Date transactionDate, Double transactionAmount, org.ejc.persist.model.Convention convention, org.ejc.persist.model.ConventionExecutive conventionExecutive, org.ejc.persist.model.Registrant registrant, org.ejc.persist.model.Price price) {
        this.transactionId = transactionId;
        this.transactionDate = new Timestamp(transactionDate.getTime());//transactionDate;
        this.transactionAmount = transactionAmount;
        this.convention = convention;
        this.conventionExecutive = conventionExecutive;
        this.registrant = registrant;
        this.price = price;
    }

    /** default constructor */
    public Transaction() {
    }

    /** minimal constructor */
    public Transaction(Integer transactionId, org.ejc.persist.model.Convention convention, org.ejc.persist.model.ConventionExecutive conventionExecutive, org.ejc.persist.model.Registrant registrant, org.ejc.persist.model.Price price) {
        this.transactionId = transactionId;
        this.convention = convention;
        this.conventionExecutive = conventionExecutive;
        this.registrant = registrant;
        this.price = price;
    }

    public Integer getTransactionId() {
        return this.transactionId;
    }

    public void setTransactionId(Integer transactionId) {
        this.transactionId = transactionId;
    }

    public Date getTransactionDate() {
        //return this.transactionDate;
    	return new Date(transactionDate.getTime());
    }

    public void setTransactionDate(Date transactionDate) {
        this.transactionDate = new Timestamp(transactionDate.getTime());
    }

    public Double getTransactionAmount() {
        return this.transactionAmount;
    }

    public void setTransactionAmount(Double transactionAmount) {
        this.transactionAmount = transactionAmount;
    }

    public org.ejc.persist.model.Convention getConvention() {
        return this.convention;
    }

    public void setConvention(org.ejc.persist.model.Convention convention) {
        this.convention = convention;
    }

    public org.ejc.persist.model.ConventionExecutive getConventionExecutive() {
        return this.conventionExecutive;
    }

    public void setConventionExecutive(org.ejc.persist.model.ConventionExecutive conventionExecutive) {
        this.conventionExecutive = conventionExecutive;
    }

    public org.ejc.persist.model.Registrant getRegistrant() {
        return this.registrant;
    }

    public void setRegistrant(org.ejc.persist.model.Registrant registrant) {
        this.registrant = registrant;
    }

    public org.ejc.persist.model.Price getPrice() {
        return this.price;
    }

    public void setPrice(org.ejc.persist.model.Price price) {
        this.price = price;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("transactionId", getTransactionId())
            .toString();
    }

}
